<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<div style="width: 640px;">
	<form class="layui-form layui-form-pane" id="userForm">
		<div class="layui-form-item">
			<div class="layui-inline"
				style="display: flex; justify-content: center; align-items: center;">
				<div class="layui-input-inline" style="width: 80px">
					<label>用户名：</label>
				</div>
				<div class="layui-input-inline">
					<input type="text" name="username" autocomplete="off"
						class="layui-input" placeholder="留空查全部">
				</div>
				<div class="layui-input-inline" style="width: 300px;">
					<button class="layui-btn" type="button" id="btn">查询</button>
				</div>
			</div>
		</div>
	</form>
	<table class="layui-table" style="text-align: center; width: 400px">
		<colgroup>
			<col width="60">
			<col width="100">
			<col width="100">
		</colgroup>
		<c:choose>
			<c:when test="${not empty UserList }">
				<thead>
					<tr>
						<th style="text-align: center">序号</th>
						<th style="text-align: center">用户名</th>
						<th style="text-align: center">钱包余额</th>
					</tr>
				</thead>
			</c:when>
			<c:otherwise>

			</c:otherwise>
		</c:choose>
		<tbody>
			<c:forEach items="${UserList }" var="item" varStatus="status">
				<tr>
					<td>${status.count }</td>
					<td>${item.username }</td>
					<td>${item.money }</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
<script>
	$("#btn").click(function() {
		loadPage("user/showUser", $("#userForm").serialize());
	});
</script>